<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1,minimum-scale=1,user-scalable=no">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>慢慢买</title>
  <link rel="stylesheet" href="./css/base.css">
  <link rel="stylesheet" href="./css/index.css">
  <link rel="stylesheet" href="./css/media.css">
  <script src="https://unpkg.com/vue/dist/vue.js"></script>
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>

<body>
  <div id="app">
    <div class="view">
      <!-- 头部部分 -->
      <div class="header">
        <div class="header_left">{{title}}</div>
        <div class="header_right">app下载</div>
      </div>
      <!-- 搜索框部分 -->
      <div class="seacher">
        <input type="text" placeholder="请输入你想要的商品" v-model="seacher">
        <button>搜索</button>
      </div>
      <!-- 导航栏部分 -->
      <div class="nav">
        <ul>
          <li v-for="(item,index) in navList" :key="item.id" >
           <a :href="item.titlehref">
              <img src="https://m.360buyimg.com/mobilecms/jfs/t16912/18/2046755333/11079/5d93a046/5ae41d1aN7c1bb190.png" alt="">
             <p>{{item.name}}</p>
           </a>
          </li>
        </ul>
      </div>
      <!-- 折扣推荐部分 -->
      <div class="discount">
          <div class="discount_title">
            <div class="title_left">超值折扣推荐</div>
            <div class="title_right">
              <a href="javascript:;"><</a>
            </div>
          </div>
          <!-- 主体部分 -->
          <div class="discount_main">
            <ul>
                 <li v-for="(item ,index) in discountMemue" :key="item.id">
                   <a href="javascript:;">
                     <img src="http://a.manmanbuy.com:8013/cuxiaoPic/201610/201610001412282758.jpg" alt="">
                     <div class="main_right">
                      <div class="main_right_top">
                        <p>{{item.productName}} <span>{{item.productPinkage}}</span></p>
                      </div>
                      <div class="main_right_bottom">
                         <div class="msg">
                           <span class="mall">{{item.productFrom}}</span>
                           <span class="time">{{item.productTime}}</span>
                         </div>
                         <div class="commit">
                           <span>{{item.productComCount}}</span>
                         </div>
                      </div>
                     </div>
                   </a>
                 </li>
            </ul>
          </div>
      </div>
      <!-- 查看更多 -->
      <div class="more">
        <a href="javascript:;">更多信息<<</a>
      </div>
    </div>
  </div>
  <script>
    var app = new Vue({
      el: '#app',
      data () {
        return {
          message: 'Hello Vue!',
          seacher: '',
          title: '',
          navList: [],
          discountMemue:[]
        }
      },
      created () {
        this.getNavData()
        this.discountMenue()
      },
      mounted() {
      },
      methods: {
        getNavData() {
          // const _this = this
          axios.get('http://193.112.55.79:9090/api/getindexmenu',{})
            .then((response = []) => {
              console.log(response.data.result);
              // const result = response.data.result ||[]
              this.navList = response.data.result
              console.log(this.navList);
            })
            .catch(error=> {
              console.log(error);
            });
        },
        discountMenue(){
          axios.get('http://193.112.55.79:9090/api/getmoneyctrl')
          .then((res = [])=>{
            console.log(res.data.result);
            this.discountMemue=res.data.result
          })
        }
      }
    });
  </script>
</body>
<!-- <script src="./js/jquery.v1.12.4.js"></script>
<script src="./js/index.js"></script> -->

</html>